package com.dingup.provider.mapper;

import com.dingup.api.enums.ClassUserTypeEnum;
import com.dingup.api.model.classInfo.ClassUserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ClassUserInfoMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(ClassUserInfo record);

    int insertSelective(ClassUserInfo record);

    ClassUserInfo selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ClassUserInfo record);

    int updateByPrimaryKey(ClassUserInfo record);

    List<ClassUserInfo> getClassUserInfoByClassAndType(@Param("classId") Integer classId,@Param("type") ClassUserTypeEnum type);

    Integer getCountByClassIdsAndType(@Param("classIds") List<Integer> classIds,@Param("type") ClassUserTypeEnum type);

    ClassUserInfo getClassUserInfo(ClassUserInfo record);

    List<String> getStudentIdsByTeacherId(@Param("teacherId") String teacherId, @Param("teacherType")ClassUserTypeEnum teacherType);

    /**
     * 获取班级的学生姓名和id
     *
     * @param classId
     * @return
     */
    List<ClassUserInfo> getUserByClassId(@Param("classId") Integer classId,
                                         @Param("type") ClassUserTypeEnum type);

    void deleteUser(String userId);
}